package data;
import java.util.Calendar;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.LinkedHashSet;
/**
 * 关注内容类
 * @author doyl
 *
 */
public class DataBuffer {
//	public static LinkedHashSet<String> bigDealCode = new LinkedHashSet<String>();//成交量增大
	public static HashSet<String> noCareCode = new HashSet<String>();
	public static LinkedHashSet<String> seconds20Code = new LinkedHashSet<String>();
	public static LinkedHashSet<String> oneMinCode = new LinkedHashSet<String>();
	public static LinkedHashSet<String> threeMinCode = new LinkedHashSet<String>();
	
	public static LinkedHashSet<String> industryOrder = new LinkedHashSet<String>();
	public static LinkedHashSet<String> sinaIndustryOrder = new LinkedHashSet<String>();
	public static LinkedHashSet<String> lowUP = new LinkedHashSet<String>();
	public static LinkedHashSet<String> verLine = new LinkedHashSet<String>();
	public static LinkedHashSet<String> bigdeal = new LinkedHashSet<String>();
	public static LinkedHashSet<String> upline = new LinkedHashSet<String>();
	public static LinkedHashSet<String> other = new LinkedHashSet<String>();
	public static LinkedHashSet<String> finalSel = new LinkedHashSet<String>();
	public static LinkedHashSet<String> own = new LinkedHashSet<String>();
	public static LinkedHashSet<String> speedUp = new LinkedHashSet<String>();
	
	private static LinkedHashSet<String> highPirceCode = new LinkedHashSet<String>();


	
//	public static LinkedHashSet<String> selectCode = new LinkedHashSet<String>();
	
	static{
//		bigDealCode.add("sh000001");
//		bigDealCode.add("sz399001");
		seconds20Code.add("sh000001");
		seconds20Code.add("sz399001");
		oneMinCode.add("sh000001");
		oneMinCode.add("sz399001");
		threeMinCode.add("sh000001");
		threeMinCode.add("sz399001");
	}
	
	public static LinkedHashSet<String> getHighPirceCode() {
		return highPirceCode;
	}
	
	public static void setHighPirceCode(LinkedHashSet<String> highPirceCode) {
		DataBuffer.highPirceCode = highPirceCode;
	}
	
	public static void addSeconds20Code(String code) {
		synchronized (seconds20Code) {
			seconds20Code.add(code);
		}
	}
	
	public static void addOneMinCode(String code) {
		synchronized (oneMinCode) {
			oneMinCode.add(code);
		}
	}
	
	public static void addThreeMinCode(String code) {
		synchronized (threeMinCode) {
			threeMinCode.add(code);
		}
	}
	
	public static LinkedHashSet<String> getSpeedUp() {
		return speedUp;
	}
//	public static void addSelectCode(String code) {
//		synchronized (selectCode) {
//			selectCode.add(code);
//		}
//	}
//	
//	public static void removeSelectCode(String code) {
//		synchronized (selectCode) {
//			selectCode.remove(code);
//		}
//	}
	
	public static LinkedHashSet<String> getSeconds20Code() {
		return seconds20Code;
	}
	
	public static LinkedHashSet<String> getOneMinCode() {
		return oneMinCode;
	}

	public static LinkedHashSet<String> getThreeMinCode() {
		return threeMinCode;
	}
	
//	public static LinkedHashSet<String> getBigDealCode() {
//		synchronized (bigDealCode) {
//			return bigDealCode;
//		}
//	}

//	public static void addBigDealCode(String code) {
//		synchronized (bigDealCode) {
//			DataBuffer.bigDealCode.add(code);
//		}
//	}
//
//	public static void removeBigDealCode(String code) {
//		synchronized (bigDealCode) {
//			bigDealCode.remove(code);
//		}
//	}
	
	public static boolean isStopThread(){
		boolean isStop = false;
		Calendar calendar = Calendar.getInstance();
		if(calendar.get(Calendar.HOUR)<9||calendar.get(Calendar.HOUR)>15){
			
			isStop = true;
		}
		return isStop;
	}

	public static LinkedHashSet<String> getIndustryOrder() {
		return industryOrder;
	}

	public static void setIndustryOrder(LinkedHashSet<String> industryOrder) {
		DataBuffer.industryOrder = industryOrder;
	}

	public static LinkedHashSet<String> getSinaIndustryOrder() {
		return sinaIndustryOrder;
	}

	public static void setSinaIndustryOrder(LinkedHashSet<String> sinaIndustryOrder) {
		DataBuffer.sinaIndustryOrder = sinaIndustryOrder;
	}

	public static LinkedHashSet<String> getLowUP() {
		return lowUP;
	}

	public static void addLowUP(String code) {
		DataBuffer.lowUP.add(code);
	}

	public static LinkedHashSet<String> getVerLine() {
		return verLine;
	}

	public static void setVerLine(LinkedHashSet<String> verLine) {
		DataBuffer.verLine = verLine;
	}

	public static LinkedHashSet<String> getBigdeal() {
		return bigdeal;
	}

	public static void setBigdeal(LinkedHashSet<String> bigdeal) {
		DataBuffer.bigdeal = bigdeal;
	}

	public static LinkedHashSet<String> getUpline() {
		return upline;
	}

	public static void setUpline(LinkedHashSet<String> upline) {
		DataBuffer.upline = upline;
	}

	public static LinkedHashSet<String> getOther() {
		return other;
	}

	public static void setOther(LinkedHashSet<String> other) {
		DataBuffer.other = other;
	}

	public static LinkedHashSet<String> getFinalSel() {
		return finalSel;
	}

	public static void setFinalSel(LinkedHashSet<String> finalSel) {
		DataBuffer.finalSel = finalSel;
	}

	public static LinkedHashSet<String> getOwn() {
		return own;
	}

	public static void setOwn(LinkedHashSet<String> own) {
		DataBuffer.own = own;
	}
}
